@extends('layout.main')
@section('content')
    <div class="col-sm-8">
        <blockquote>
            <p><img src="{{$user[0]->user->avatar}}" alt="" class="img-rounded" style="border-radius:500px; height: 40px"> {{$user[0]->user->name}}
            </p>


            <footer>关注：{{count($fan)}}｜粉丝：{{count($start)}}｜文章：{{count($user)}}</footer>
                    </blockquote>
                           @if(Auth::id()!=$id)
                          
                            @if($user1->starts()->where('start_id','=',$id)->exists())
                        <button class="btn btn-default like-button pan" like-value="0" like-user="{{$id}}" _token="MESUY3topeHgvFqsy9EcM916UWQq6khiGHM91wHy" type="button">取消关注</button>
                         @else
                        <button class="btn btn-default like-button pan" like-value="1" like-user="{{$id}}" _token="MESUY3topeHgvFqsy9EcM916UWQq6khiGHM91wHy" type="button">关注</button>
                            @endif
                        @endif

    </div>
    <div class="col-sm-8 blog-main">
        <div class="nav-tabs-custom">
            <ul class="nav nav-tabs">
                <li class="active"><a href="#tab_1" data-toggle="tab" aria-expanded="true">文章</a></li>
                <li class=""><a href="#tab_2" data-toggle="tab" aria-expanded="false">关注</a></li>
                <li class=""><a href="#tab_3" data-toggle="tab" aria-expanded="false">粉丝</a></li>
            </ul>
            <div class="tab-content">
                <div class="tab-pane active" id="tab_1">
                        @foreach($user as $u)
                                            <div class="blog-post" style="margin-top: 30px">
                                                        <p class=""><a href="/user/5">{{$u->user->name}}</a> {{$u->created_at}}</p>
                            <p class=""><a href="/posts/62" >{{$u->title}}</a></p>


                            <p><p></p>
                        </div>
                        @endforeach
                                            </div>
                <!-- /.tab-pane -->
                <div class="tab-pane" id="tab_2">
                             @foreach($start as $s)
                                                                    <div class="blog-post" style="margin-top: 30px">
                            <p class="">{{$s->name}}</p>
                            <p class="">关注：{{$s->starts_count}}| 粉丝：{{$s->fans_count}}｜ 文章：{{$s->post_count}}</p>

                            <div>

                                                  @if(Auth::id()==$id)
                        <button class="btn btn-default like-button" like-value="1" like-user="2" _token="MESUY3topeHgvFqsy9EcM916UWQq6khiGHM91wHy" type="button">取消关注</button>
                        @endif

            </div>

                        </div>
                        @endforeach
                                    </div>
                <!-- /.tab-pane -->
                <div class="tab-pane" id="tab_3">
                                @foreach($fan as $f)
                                <div class="blog-post" style="margin-top: 30px">
                            <p class="">{{$f->name}}</p>
                             <p class="">关注：{{$f->starts_count}}| 粉丝：{{$f->fans_count}}｜ 文章：{{$f->post_count}}</p>

                            <div>
                            @if(Auth::id()==$id)
                        <button class="btn btn-default like-button" like-value="1" like-user="2" _token="MESUY3topeHgvFqsy9EcM916UWQq6khiGHM91wHy" type="button">取消关注</button>
                        @endif
                            @endforeach
            </div>

                        </div>
                                    </div>
                <!-- /.tab-pane -->
            </div>
            <!-- /.tab-content -->
        </div>


    </div><!-- /.blog-main -->



        <div id="sidebar" class="col-xs-12 col-sm-4 col-md-4 col-lg-4">




    </aside>
</div>
 @endsection